<template>
	<div :class="['widgets-home', customizing ? 'customizing' : '']" ref="main">
		<div class="widgets-content">
			<el-form :model="form" :rules="rules" ref="dialogForm" :disabled="mode == 'show'" label-width="110px" label-position="top">
				<el-row :gutter="1">
					<el-col :span="24">
                        <div class="titleBox">
                            BOM正向查询
                            <!-- <div>
                                <el-button icon="el-icon-filter" type="primary" @click="submit">展开过滤</el-button>
                                <el-button icon="el-icon-filter" type="primary" @click="submit">收起过滤</el-button>
                            </div>
                            <div>
                                <el-button type="primary" @click="submit">刷新</el-button>
                            </div> -->
                        </div>
					</el-col>
				</el-row>
				<el-card class="box-card">
					<el-row :gutter="1">
						<el-col :xs="24" :sm="3">
							<el-form-item label="物料" prop="goods_code">
								<el-input v-model="search.goods_code" placeholder="请输入" clearable @change="upsearch"></el-input>
							</el-form-item>
						</el-col>
						<el-col :xs="24" :sm="3">
							<el-form-item label="BOM单编号" prop="bom_code">
								<el-input v-model="search.bom_code" placeholder="请输入" clearable @change="upsearch"></el-input>
							</el-form-item>
						</el-col>
						<!-- <el-col :xs="24" :sm="3">
							<el-form-item label="子件BOM审核状态" prop="check_status">
                                <el-select v-model="form.check_status"  filterable  placeholder="审核状态" clearable>
                                    <el-option label="待审核" :value="0"/>
                                    <el-option label="审核通过" :value="1"/>
                                    <el-option label="审核拒绝" :value="2"/>
                                </el-select>
							</el-form-item>
						</el-col>
						<el-col :xs="24" :sm="3">
							<el-form-item label="展开方式" prop="goods_name">
								<el-input v-model="form.goods_name" placeholder="请输入" clearable></el-input>
							</el-form-item>
						</el-col> -->
					</el-row>
					<el-row :gutter="1">
						<el-col :xs="24" :sm="24" style="display: flex;align-items: center;justify-content: flex-end;">
							<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
							<el-button type="info" @click="refresh">重置</el-button>
						</el-col>
					</el-row>
				</el-card>
				<el-card class="box-card">
					<el-row :gutter="1">
						<el-col :span="24">
							<div class="titleBox titleBox1">
								子件信息
							</div>
						</el-col>
					</el-row>
					<el-row :gutter="1">
						<el-col :span="24">
							<scTable ref="table" :data="data" row-key="id"  @selection-change="selectionChange" stripe remoteSort remoteFilter border height="420">
								<el-table-column label="层级" prop="customAddress"></el-table-column>
								<el-table-column label="物料图片" prop="customAddress"></el-table-column>
								<el-table-column label="物料编号" prop="goods_code"></el-table-column>
								<el-table-column label="物料名称" prop="goods_name"></el-table-column>
								<el-table-column label="规格型号" prop="goods_spec"></el-table-column>
								<el-table-column label="辅助属性" prop="customAddress"></el-table-column>
								<el-table-column label="BOM单编号" prop="bom_code"></el-table-column>
								<el-table-column label="BOM版本" prop="fver"></el-table-column>
								<el-table-column label="基本单位" prop="unit_name"></el-table-column>
								<el-table-column label="产品产量" prop="all_number"></el-table-column>
								<el-table-column label="材料用量" prop="use_number"></el-table-column>
								<el-table-column label="标准用量" prop="customAddress"></el-table-column>
								<el-table-column label="发料方式" prop="method_all"></el-table-column>
								<el-table-column label="发料仓库" prop="ware"></el-table-column>
								<el-table-column label="物料类别" prop="customAddress"></el-table-column>
								<el-table-column label="物料标签" prop="customAddress"></el-table-column>
								<!-- <el-table-column label="物料备注" prop="customAddress"></el-table-column> -->
							</scTable>
						</el-col>
					</el-row>
				</el-card>
			</el-form>
		</div>
	</div>
</template>

<script>

export default {
	name: '新增BOM',
	components: {},
	data() {
		return {
            search:{
                bom_code: null,
                goods_code: null,
            },
            data:[]
		}
	},
	methods: {
		/**获取单位*/
		async upsearch(){
			var res = await this.$API.bom.bom.search.get(this.search);
			this.data = res.data
		},
	}
}
</script>
<style>
.sc-upload-multiple[data-v-f680f9e4] .el-upload--picture-card {
	width: 60px;
	height: 60px;
}

[data-v-f680f9e4] .el-upload-list__item {
	width: 60px;
	height: 60px;
}
</style>
<style lang="scss">
.widgets-home {
	display: flex;
	flex-direction: row;
	flex: 1;
	min-height: 100%;
	max-height: 100%;
}

.widgets-content {
	flex: 1;
	overflow: auto;
	overflow-x: hidden;
	padding: 15px 15px;
	.selectBox {
		display: flex;
		align-items: center;
	}
	.el-col {
		margin-right: 20px;
	}
	.el-form-item {
		flex-direction: column;
		justify-content: flex-start;
		align-items: flex-start;
		.el-form-item__label {
			justify-content: flex-start;
		}
	}
	.box-card {
		margin-bottom: 10px;
	}
	.box-card1 {
		.el-form-item__label {
			justify-content: flex-start;
			height: 0;
		}
	}
	.box-card2 {
		.el-col {
			margin-right: 0;
		}
	}
	.el-form {
		//background: #ffffff;
		min-height: 90%;
		.titleBox {
			font-size: 18px;
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			color: #333333;
			padding-bottom: 10px;
			border-bottom: 1px solid #E6E6E6;
			margin-bottom: 14px;
			display: flex;
			align-items: center;
			justify-content: space-between;
			.el-button {
				width: 120px;
				border-radius: 10px;
				height: 30px;

			}
		}
		.titleBox1 {
			font-weight: 600;
			border: none;
			font-size: 16px;
		}
	}
}

.customizing .widgets-wrapper {
	margin-right: -360px
}

.customizing .widgets-wrapper .el-col {
	padding-bottom: 15px;
}

.customizing .widgets-wrapper .draggable-box {
	border: 1px dashed var(--el-color-primary);
	padding: 15px;
}

.customizing .widgets-wrapper .no-widgets {
	display: none;
}

.customizing .widgets-item {
	position: relative;
	margin-bottom: 15px;
}

@media (max-width: 992px) {
	.customizing .widgets {
		transform: scale(1) !important;
	}

	.customizing .widgets-aside {
		width: 100%;
		position: absolute;
		top: 50%;
		right: 0;
		bottom: 0;
	}

	.customizing .widgets-wrapper {
		margin-right: 0;
	}
}
</style>
